--ffscreen
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include('shared.lua')

function ENT:Initialize()
		self.ang = self.ang or self:GetAngles() 
		
		self.Entity:SetModel("models/props_combine/combine_intmonitor003.mdl")
		self.Entity:PhysicsInit( SOLID_BBOX )
		self.Entity:SetMoveType( MOVETYPE_NONE )
		self.Entity:SetSolid( SOLID_BBOX )
		self.Entity:DrawShadow(true)
		self.Entity:GetPhysicsObject():EnableMotion(false)
		self:SetUseType( 3 )
		self:SetAngles(self.ang)
end

function ENT:Use( activator, caller, type, value )
	if ( activator:IsPlayer() ) then
		local cpos = self:Getcpos(activator)
		cpos = cpos*self.res
		if self:Hovered(cpos,self.btnPay.x - self.btnPay.w/2, self.btnPay.y, self.btnPay.w, self.btnPay.h) then
			GAMEMODE:BuyTicket(activator,self:GetNetworkedString("label"),self:GetNetworkedString("cost",0))
		end
	end
end

function ENT:KeyValue( key, value )
	if ( key == "ang" ) then
		local ang = string.Explode(" ",value)
		self.ang = Angle(ang[1],ang[2],ang[3])
	end
end

function ENT:StartTouch( entity )
end

function ENT:EndTouch( entity )
end

function ENT:Touch( entity )
end